<?php include_once './application/views/sys_admin/common/header.php';  ?>
<!-- admin_main -->
<div class="admin_main">
	<!-- Admin_top end -->
	<?php include_once './application/views/sys_admin/common/user_left.php';  ?>
	<!-- Admin_Left End -->
	<div class="admin_right">
		<div class="admin_right_title">
			<strong>客户管理</strong> &gt;&gt; 认证信息列表
		</div>	
		<?php  
		$statusArr = $p['statusArr'];
		?>
		<div class="admin_right_con">
			<table border="0" cellspacing="1" cellpadding="0">
			  <tr style="color:#0068b7;">
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>ID</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>用户名</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>真实姓名</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>实名认证</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>是否VIP</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>VIP到期时间</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>所属客服</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>邮箱认证</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>手机认证</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>现场认证</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>注册时间</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>操作</strong></td>
			  </tr>
			  <?php foreach($list as $info){?>
			  <tr>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $info['user_id'];?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $info['username'];?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $info['realname'];?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo isset($statusArr[$info['real_status']]) ? $statusArr[$info['real_status']] : $statusArr['2'];?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php if (isset($info['vip_status']) && $info['vip_status']==1){if ($info['vip_verify_time']+3600*24*365<time()){echo "<span style='color:red;'>已过期</span>";}else{echo $statusArr[$info['vip_status']];}}else{echo $statusArr['0'];} ?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php if (isset($info['vip_status']) && $info['vip_status']==1){echo date('Y-m-d',$info['vip_verify_time']+3600*24*365);}?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php if (isset($info['vip_status']) && $info['vip_status']==1){echo $kefu_list[$info['kefu_userid']]['username'];}?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo isset($statusArr[$info['email_status']]) ? $statusArr[$info['email_status']] : $statusArr['2'];?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo isset($statusArr[$info['phone_status']]) ? $statusArr[$info['phone_status']] : $statusArr['2'];?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo isset($statusArr[$info['scene_status']]) ? $statusArr[$info['scene_status']] : $statusArr['2'];?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo date('Y-m-d H:i',$info['add_time']);?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF">
					<a href="/sys_admin/user/attestation_info?user_id=<?php echo $info['user_id'];?>">全部资料</a>&nbsp;&nbsp;||&nbsp;&nbsp;
					<!--<a href="javascript:view(<?php echo $info['user_id'];?>,'<?php echo $info['username'];?>');">奖励VIP期限</a>-->
				</td>
			  </tr>
			  <?php }?>
			  <tr>
			  	<td colspan="12" align="right" bgcolor="#FFFFFF">
			  		<form action="" method="get">
			  			用户名：<input type="text" id="username" name="username" value="<?php echo $parms['username'];?>" />
			  			真实姓名：<input type="text" id="realname" name="realname" value="<?php echo $parms['realname'];?>" />
			  			<input type="submit"/>
			  		</form>
			  	</td>
			  </tr>
			  <tr>
			  	<td height="35" colspan="12" align="center" class="page" bgcolor="#FFFFFF"><?php echo $this->pagination->create_links();?></td>
			  </tr>
			</table>
			</div>
	</div>
<!-- Admin_Right End -->
</div>
<!-- admin_main end -->
<div id="dialog" title="用户信息" style="display:none">
<form id="vip_award">
<input type="hidden" id="uid" name="uid">
<table border="0" width="100%">
<tr><td>用户名</td><td><span id="uname"></span></td></tr>
<tr><td>奖励</td><td><input id="day" name="day">天</td></tr>
<tr><td colspan="2" style="color:red">*请注意：单位为天，一个月输入30天，一年输入365天</td></tr>
</table>
</form>
</div>

</body>
<script>
function view(uid,uname){
	document.getElementById('uid').value=uid;
	document.getElementById('uname').innerHTML=uname;
	document.getElementById('day').value="";
	$('#dialog').dialog({
		width:400,
		height:200,
		//modal:false, //蒙层（弹出会影响页面大小）
		title:'VIP奖励',
		buttons:{"确定":function(){award();},"取消":function(){$(this).dialog("close");}},
	}); 
}

function award(){
	var options = {
		url : '/sys_admin/user/award_vip',
		dataType: "text",
		type:"post",
		success : function(ret) {
			alert(ret);
			$('#dialog').dialog("close");
			location.reload();
		}
	};
	$("#vip_award").ajaxSubmit(options);
	return false;
}
</script>
</html>
